<?php
/* @var $this ProductController */
/* @var $model Product */
$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'产品管理'=>array($this->pre_module_url.'/productSale/admin'),
	'宝贝推荐'=>array($this->pre_module_url.'/product/recommend'),
);
?>
<div class="hr_10"></div>
<div class="remind_box ff_s c_f">
	<a class="c_06c f_r mr10" href="/manage/product/recommend" title="">重新选择</a><span>您当前选择的推荐页面：<a
		href="javascript:" title="">推荐位内容管理</a> &gt; <?php echo $position->zpo_title;?>
		(<?php echo Positions::model()->type[$position->zpo_type]; ?>)
	</span>
</div>
<div class="hr_12"></div>

<table class="list_table list_table2" width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<th width="" class="pl15">内容标题</th>
		<th width="17%">店铺名称</th>
		<th width="19%">开始/结束时间</th>
		<th width="15%">状态</th>
		<th width="12%">操作</th>
	</tr>
</table>

<?php $this->widget ( 'zii.widgets.CListView', array (
	'dataProvider' =>$model->dataSearch(Yii::app()->request->getParam('zpoid',0)),
	'itemView' => $view,
	'selectAll'=>array('ids[]','id[]'),
	'itemsTagName'=>'table',
	'itemsOptions'=>array('class'=>'list_table list_table2','width'=>'100%','cellpadding'=>0,'cellspacing'=>0),
	'artLink'=>array(
		//设为头条
		array(Yii::t('adm','Del Recommend'),$this->pre_module_url.'/product/deleterecommend','确认批量删除推荐！'),
	),
	'batchItem'=>array(
		//批量廷期
		CHtml::linkbtn('批量延期','javascript:',array('onclick'=>'postpone()')),
		//导出列表
		CHtml::linkbtn('添加内容',array('addrecommend','zpoid'=>$_GET['zpoid'],'type'=>$_GET['type']))
	),
) );
?>

<script language="javascript" type="text/javascript" src="<?php echo Yii::app()->baseUrl;?>/js/My97DatePicker/WdatePicker.js"></script>
<script>  
//批量廷期
function postpone(){
	if($('.chk:checked').length==0){
		art.dialog({title: '错误',content: '所选项不能为空！'}).time(1000);
		return;
	}
	art.dialog({
	    title: '推荐廷期',
	    okValue:'确认',
	    cancelValue:'取消',
	    width: 280,
	    height: 100,
	    fixed: true,
	    content: "<form id='art_dialog'  method='post' action='<?php echo $this->pre_module_url?>/product/commendPostpone' ><div class='updtitle'><p class='fs_14 jg' style='margin-top:10px;'>延期至:<input type='text' id='newtitle' name='zpl_end_time' onclick='WdatePicker({dateFmt:\"yyyy-MM-dd HH\"})'></p><p id='proid'></p></div></form>",
	    ok: function () {
	        $("#art_dialog").submit();
	        return false;
	    },
	    cancel: function () {
	    	return true;
	    }
	});
   var e = document.getElementsByName('id[]');	//alert(e.length)	;
   for (var i=0; i<e.length; i++){
	   if(e[i].checked){
		   $('#art_dialog').append("<input type='hidden' name='ids[]' value='"+e[i].value+"' />");
	   }
	}
}
</script> 